package com.example.demo;

import org.springframework.web.bind.annotation.*;

@RestController
//类路径
@RequestMapping("/user")
public class PracticeController {
    //方法路径
    @RequestMapping(value = "/print1",method = RequestMethod.GET)
    public String print1(){
        return "print1";
    }

    //可以用GetMapping等同于上面的话, 只支持get请求
    @GetMapping("/print2")
    public String print2(){
        return "print2";
    }
    
    @RequestMapping(value = "/print3", method = RequestMethod.POST)
    public String print3(){
        return "print3";
    }

    @PostMapping("/print4")
    public String print4(){
        return "print4";
    }
}
